﻿@model EatOutAdvocate.Web.Mvc.Models.RegisterModel

@{
    ViewBag.Title = "Register";
}

@section pagetitle {
    <span class="muted">@ViewBag.Title</span>
}

<div class= "form-signin">
    @using (Html.BeginForm())
    {
        @Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")
            <fieldset>
                <div class="span3">
                    <legend>Create a New Account</legend>

                    @Html.TextBoxFor(m => m.UserName, new { @class = "input-block-level", placeholder = "Username" })
                    <span class="text-error">
                        @Html.ValidationMessageFor(m => m.UserName)
                    </span> 
                    
                    
                    @Html.TextBoxFor(m => m.Email, new { @class = "input-block-level", placeholder = "Email Address" })
                    <span class="text-error">
                        @Html.ValidationMessageFor(m => m.Email)
                    </span>
                    
                    @Html.PasswordFor(m => m.Password, new { @class = "input-block-level", placeholder = "Password; at least 6 characters" })
                    <span class="text-error">
                        @Html.ValidationMessageFor(m => m.Password)
                    </span>

                    @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "input-block-level", placeholder = "Confirm Password" })
                    <span class="text-error">
                        @Html.ValidationMessageFor(m => m.ConfirmPassword)
                    </span>
                    
                    <br />
                    <input class="btn btn-primary" type="submit" value="Register" />
                </div>
                <div class="span1 centered">
                    <div class="centered">
                        <h1 class="muted">OR</h1>
                    </div>
                </div>
                <div class="span3">
                    <legend>Login with a Social Account</legend>
                    <div class="fb-login-button" data-show-faces="true" data-width="300" data-max-rows="5"></div>
                </div>
            </fieldset>
    }
    
    <div style="clear: both"></div>
</div>

@section footer {
    <script type="text/javascript">
        window.fbAsyncInit = function () {
            FB.init({
                appId: '388197291260383', // App ID
                status: true, // check login status
                cookie: true, // enable cookies to allow the server to access the session
                xfbml: true  // parse XFBML
            });

            // Additional initialization code here
        };

        // Load the SDK Asynchronously
        (function (d) {
            var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
            if (d.getElementById(id)) { return; }
            js = d.createElement('script'); js.id = id; js.async = true;
            js.src = "//connect.facebook.net/en_US/all.js";
            ref.parentNode.insertBefore(js, ref);
        } (document));
    </script>
}